m = int(input('请输入矩形的行数：'))
n = int(input('请输入矩形的列数：'))
ch = input('请输入构成矩形的字符：')

for i in range(m):
    for j in range(n):
        if j % n == 0:
            print()
        print(ch, end=' ')
